/*package com.kma.summer2012.factory;

import com.kma.summer2012.dao.UserDAO;
import org.springframework.beans.factory.annotation.Autowired;

public class DAOFactory {

    private UserDAO userDAO;

    public UserDAO getUserDAO() {
        return userDAO;
    }

    public void setUserDAO(UserDAO userDAO) {
        this.userDAO = userDAO;
    }
}
*/
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kma.summer2012.factory;

import com.kma.summer2012.dao.*;
import com.kma.summer2012.model.*;

import java.util.Map;

public class DAOFactory {

    Map<Class, DAO> daos;

    // TODO why I can't get any DAO without method?

    public DAO<CrumbsUser> getCrumbsUserDAO() {
        return daos.get(CrumbsUserDAOImpl.class);
    }

    public DAO<CrumbsClient> getCrumbsClientDAO() {
        return daos.get(CrumbsClientDAOImpl.class);
    }

    public DAO<CrumbsAdditionalTools> getCrumbsAdditionalToolsDAO() {
        return daos.get(CrumbsAdditionalToolsDAOImpl.class);
    }

    public DAO<CrumbsCatalogOfTools> getCrumbsCatalogOfToolsDAO() {
        return daos.get(CrumbsCatalogOfToolsDAOImpl.class);
    }

    public DAO<CrumbsCatalogOfWork> getCrumbsCatalogOfWorkDAO() {
        return daos.get(CrumbsCatalogOfWorkDAOImpl.class);
    }

    public DAO<CrumbsDateAndTime> getCrumbsDateAndTimeDAO() {
        return daos.get(CrumbsDateAndTimeDAOImpl.class);
    }

    public DAO<CrumbsPosition> getCrumbsPositionDAO() {
        return daos.get(CrumbsPositionDAOImpl.class);
    }

    public DAO<CrumbsProcessHistory> getCrumbsProcessHistoryDAO() {
        return daos.get(CrumbsProcessHistoryDAOImpl.class);
    }

    public DAO<CrumbsRequest> getCrumbsRequestDAO() {
        return daos.get(CrumbsRequestDAOImpl.class);
    }

    public DAO<CrumbsRequestAndWork> getCrumbsRequestAndWorkDAO() {
        return daos.get(CrumbsRequestAndWorkDAOImpl.class);
    }

    public DAO<CrumbsRequestsState> getCrumbsRequestsStateDAO() {
        return daos.get(CrumbsRequestsStateDAOImpl.class);
    }

    public void setDaos(Map<Class, DAO> daos) {
        this.daos = daos;
    }
}
